package xyz.zdsoft.project_group_manage_module.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zdsoft.common.utils.Result;
import xyz.zdsoft.project_group_manage_module.entity.MyDto.RespPageBean;
import xyz.zdsoft.project_group_manage_module.entity.MyDto.TeamGch;
import xyz.zdsoft.project_group_manage_module.service.TermSelTeamGService;
import javax.annotation.Resource;
import java.util.HashMap;

@RestController
@Api(tags = "项目组管理")
public class AdminTermSelTeamController {
    @Resource
    private TermSelTeamGService termSelTeamGService;

    @ApiOperation("条件查询项目组成员(分页)")
    @PostMapping("/TermSelTeamStudent")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",example = "1",required = true),
            @ApiImplicitParam(name = "size",value ="每页数量",example = "5",required = true),
            @ApiImplicitParam(name = "teamName",value ="项目组名(可模糊查询)"),
            @ApiImplicitParam(name = "studentName",value = "学生名字(可模糊查询)"),
            @ApiImplicitParam(name = "userNo",value = "学号(精准查询)"),
    })
    public Result<TeamGch> SelTeamStudent(Integer currentPage, Integer size, String teamName, String studentName, String userNo){
        return Result.ok().message("查询成功").data(termSelTeamGService.SelTeamStudent(currentPage,size,teamName,studentName,userNo));
    }
    @ApiOperation("条件查询项目组")
    @PostMapping("/TermSelTeam")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "teamName",value = "项目组名"),
            @ApiImplicitParam(name = "isGraduation",value = "是否结业(0：未结业,1:已结业)")
    })
    public Result TermSelTeam(String teamName,String isGraduation){
        HashMap<String,Object> map=new HashMap<>();
        map.put("teamName",teamName);
        map.put("isGraduation",isGraduation);
        return Result.ok().message("查询成功").data(termSelTeamGService.TermSelTeam(map));

    }


}
